package org.aurora.framework.boot.rpc.dubbo.configure;

import org.aurora.framework.boot.rpc.dubbo.aop.FacadeValidatorMethodInterceptor;
import org.aurora.framework.boot.rpc.dubbo.aop.FacadeValidatorPointcutAdvisor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * DubboAutoConfiguration
 * <pre>
 * description:
 * create date: 2025-03-23 00:40:50
 * </pre>
 *
 * @author cao.yong
 */
@AutoConfiguration
@EnableAspectJAutoProxy
public class DubboAutoConfiguration {

    @Bean
    public FacadeValidatorMethodInterceptor facadeValidatorMethodInterceptor() {
        return new FacadeValidatorMethodInterceptor();
    }

    @Bean
    public FacadeValidatorPointcutAdvisor facadeValidatorPointcutAdvisor(FacadeValidatorMethodInterceptor interceptor) {
        FacadeValidatorPointcutAdvisor advisor = new FacadeValidatorPointcutAdvisor();
        advisor.setAdvice(interceptor);
        return advisor;
    }
}
